/**
 * bar搜索条件和form搜索条件合并
 * @param formState
 * @returns
 */
export function useFilterBarState(formState: Record<string, any>) {
  const filterBarState = ref({})

  const queryState = reactive({
    ...filterBarState,
    ...formState
  })
  watch(
    [filterBarState, formState],
    ([a, b]) => {
      Object.assign(queryState, a, b)
    },
    { immediate: true, deep: true }
  )

  return { filterBarState, queryState }
}
